import Vue from 'vue'
import Router from 'vue-router'
import _import from './_import'
import Layout from '@/views/layout/Layout'

Vue.use(Router)

export const index = {
    path: '/',
    redirect: '/dashboard/index',
    hidden: true
}

export const dashboardRouter = {
    path: '/dashboard',
    component: Layout,
    noDropDown: true,
    children: [
        { path: 'index', name: '控制台', component: _import('dashboard/index') }
    ]
}

export const asyncAppRouter = [
    {
        path: '/upms',
        name: '授权中心',
        component: Layout,
        redirect: 'noredirect',
        icon: 'el-icon-mars-app',
        children: [
            {path: 'app', name: '应用管理', component: _import('dashboard/index')},
            {path: 'menu', name: '菜单管理', component: _import('dashboard/index')},
            {path: 'permission', name: '权限管理', component: _import('dashboard/index')},
            {path: 'organization', name: '组织管理', component: _import('dashboard/index')},
            {path: 'user', name: '用户管理', component: _import('dashboard/index')},
        ]
    }
]

export const constantRouters = [
    index,
    dashboardRouter,
    ...asyncAppRouter
]

export default new Router({
    routes: constantRouters
})